﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;

namespace IService
{
    public interface IJurisdictionService
    {
        /// <summary>
        /// 新增子模块
        /// </summary>
        /// <param name="jurisdiction">子模块实体</param>
        /// <returns>新增后的子模块（包含自动生成的ID）</returns>
        Task<int> CreateAsync(Jurisdiction jurisdiction);

        /// <summary>
        /// 根据ID查询子模块
        /// </summary>
        /// <param name="juriId">子模块ID</param>
        /// <returns>子模块实体（无结果则返回null）</returns>
        Task<Jurisdiction> GetByIdAsync(int juriId);

        /// <summary>
        /// 查询所有子模块
        /// </summary>
        /// <returns>子模块列表</returns>
        Task<List<Jurisdiction>> GetAllAsync();

        /// <summary>
        /// 根据父模块ID查询子模块
        /// </summary>
        /// <param name="groupId">父模块ID</param>
        /// <returns>子模块列表</returns>
        Task<List<Jurisdiction>> GetByGroupIdAsync(int groupId);

        /// <summary>
        /// 修改子模块
        /// </summary>
        /// <param name="jurisdiction">包含更新信息的子模块实体</param>
        Task<int> UpdateAsync(Jurisdiction jurisdiction);

        /// <summary>
        /// 根据ID删除子模块
        /// </summary>
        /// <param name="juriId">子模块ID</param>
        Task<int> DeleteAsync(int juriId);
    }
}